1. Field of the Invention
This invention relates generally to security, and, more particularly, to a method and apparatus for securing portions of a memory within data processing systems.
2. Description of the Related Art
Microprocessors for personal computers are typically designed to provide a variety of hardware protection mechanisms that may be utilized by computer programmers. These protection mechanisms are often vital to the integrity and security of operating systems (OS) that run on the personal computers.
The architecture of x86 microprocessors, for example, provides a protection mechanism that operates at a segment and page level. The x86 microprocessor's segment-protection mechanism typically recognizes four privilege levels, numbered from zero to three, where the higher the privilege level, the lower the privilege. Thus, a software application having a privilege level of zero has the highest privilege, and typically has the full rights to substantially all of the resources. The x86 protection mechanism provides the ability to limit access to certain segments or pages based on privilege levels. For instance, critical operating-system code and data may be protected if placed in more privileged segments than those containing application code. The microprocessor's protection mechanism may allow application code to access the operating-system code and data only in a controlled, defined manner.
Operating systems, which generally operate at privilege level zero, utilize hardware protection mechanisms and the different privilege levels to protect resources under its control. It is not unusual for modem-day operating systems and the associated drivers to have over a million lines of code, which means that, in an x86 architecture, all of these lines of code would have complete access to all of the computer's resources. Not surprisingly, the large size and complexity of the existing and new operating systems have made it a challenging feat to maintain the integrity and security of the system. It is particularly difficult to insure that today's large and often complex operating systems are free of security defects (or other bugs). These security defects, in turn, place the resources managed by the operating system at risk, and open the entire operating system and platform to attacks from viruses or other malicious programs.
The x86 architecture, for example, does not provide a mechanism for both read and write protecting portions of the memory. Currently, page tables are utilized to offer write protection for selected regions of the memory, but no equivalent mechanism exists for read protecting those regions of the memory. It is therefore possible for a malicious program to create a new page table mapping to circumvent the write protection. That is, a program, operating at the zero privilege level, can access the protected memory region by first creating an alias page table that maps to the physical address of the protected memory region and then updating its table entry to make the protected memory region write enabled. The program can then access the memory region without authorization.
The present invention is directed to overcoming, or at least reducing the effects of, one or more of the problems set forth above.